<style>
#form_na label{
 font-family: Arial, Verdana;
    text-shadow: 2px 2px 2px #ccc;
    display: inline-block;
    float: left;
    font-weight: bold;
    width: 173px;
    font-size: 14px;
	margin-top:6px;
}
</style>
<h1>Frequently Asked Questions</h1><hr>
<ul id="accordion">
<?php
foreach($faq as $key){
?>
    <li><div><img src="<?=base_url();?>assets/images/off.png" width="15px;" />&nbsp;<?=$key['pertanyaan'];?></div>
        <ul>
            <li class="isiaccordion"><?=$key['jawaban'];?></li>
        </ul>
    </li>
<?php
}
?>
</ul>
<hr />
<fieldset id="form_na">
	<h2>Kirimkan pertanyaan anda kepada kami mengenai seputar bikinkaosbebas.com, isikan pada form pertanyaan dibawah ini:</h2>
<form name="form-tanya" id="form-tanya" method="post">
<input type="hidden" name="sts" id="sts" value="add"/>
<label>Nama</label> : <input type="text" name="nama" class="easyui-validatebox text_na" placeholder="Isi Nama Anda" /><br /><br />
<label>Email</label> : <input type="text" name="email" class="easyui-validatemail text_na" placeholder="Isi Alamat Email Anda" /><br /><br />
<label >Pertanyaan</label> <span style=" display:inline-block;vertical-align:top;margin-top:7px;">:</span> <textarea name="pertanyaan" class="easyui-validatebox text_na" id="pertanyaan" placeholder="Masukan Pertanyaan Anda seputar BikinKaosBebas.com"></textarea><br /><br />
</form>
<label>Isi Capcha</label><span style=" display:inline-block;vertical-align:top;margin-top:7px;">:</span>
	<div id="imgVRCaptha" style="font-family: inherit; background-repeat: no-repeat; background-position: 0px 0px; width:300px; margin-left:180px; margin-top:-20px;">
	<div style="margin-left:120px; display:inline-block;">
	<img onClick="refreshCaptcha('imgVRCaptha');" style="cursor: pointer;" src="<?=base_url()?>assets/css/easyui/icons/arrow_refresh.png">		
	<input id='edVRCaptcha' name='edVRCaptcha' class="easyui-validatebox"  type='text' style="width: 86px; height: 24px; border: 1px solid #99bbe8;" />
	</div>
	</div>
<a id="simpan" href="#" style="float:right"><span id="nm_simpan">Kirim</span></a>
</fieldset>
<script>
refreshCaptcha('imgVRCaptha');
$(".easyui-validatebox").validatebox({required:true } );
$(".easyui-validatemail").validatebox({required:true,validType:'email'}); 
$('#simpan').linkbutton({  
	iconCls: 'mail_na'  
});

		$('#simpan').bind('click',function(){
				if($('#form-tanya').form('validate')){
					$.post(host+'frontend/checkCaptcha/'+$('#edVRCaptcha').val(),function(r){
						if(r=='sama'){loadingna();simpan_coy();}
						else{$.messager.alert("FAQ","Capcha Salah",'error');refreshCaptcha('imgVRCaptha');return false;}
					});
					
				}
	 			else{return false;}
		  });
		  
function simpan_coy(){
	jQuery('#form-tanya').form('submit',{
					url:host+'frontend/input_pertanyaan/tbl_faq',
					onSubmit: function(){
						  return $('#form-tanya').form('validate');
					},
					success:function(r){
						console.log(r);
						if(r==1){
							winLoadingClose();
							$.messager.alert("FAQ","Pertanyaan Anda Sudah Terkirim, Pihak Admin Akan Mengkonfirmasinya.. Terima Kasih",'info');
							clear_form_na('form-tanya');
							$('#edVRCaptcha').val('');
							refreshCaptcha('imgVRCaptha');
						}
							
						else{winLoadingClose();$.messager.alert("FAQ","FAQ GAGAL",'error');}
						 
					},
					
					error:function(data){
						$.messager.alert("FAQ","FAQ GAGALLLL",'error');
					}
				});
}
</script>